<template>
	<view class="content">
		<view class="item">
			<view class="colmun" @tap="goDetail(item.user_id)" v-for="(item,index) in list" :key="index">
				<text>{{item.nickname}}</text>
				<text class="phone">{{item.mobile}}</text>
				<text class="name">{{item.address}}</text>
				<image src="../../../static/right.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				list: [],
				last_page: 1
			}
		},
		onReachBottom() {
			if(this.last_page - this.page >= 0){
				this.loadData()
				this.page++;
			}
		},
		onLoad() {
			this.loadData()
		},
		methods: {
			goDetail(item){
        console.log(item)
				uni.navigateTo({
					url:'/pages/componentB/xiangdata/xiangdata?item=' + item
				})
			},
			loadData(){
				this.$http.post('/api/userinfo/townusers',{
					page: this.page,
					limit: '30',
				}).then(res => {
					console.log(res.data.data)
					if(this.page == 1){
						this.list = res.data.data
						this.page =2
					}else{
						this.list = this.list.concat(res.data.data)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.content{
	min-height: 100vh;
	background-color: #F8F8F8;
	padding: 30rpx;
	box-sizing: border-box;
}
.item{
	padding: 0 30rpx;
	box-sizing: border-box;
	width: 690rpx;
	background:rgba(255,255,255,1);
	border-radius:20px;
	margin-bottom: 30rpx;
}
.colmun{
	padding: 30rpx;
	box-sizing: border-box;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	border-bottom: 1px solid rgba(0,0,0,.05);
	.name{
		margin-right: 15rpx;
	}
	&:last-child{
		border: none;
	}
	text{
		font-size:17px;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(51,51,51,1);
	}
	.phone{
		font-size:13px;
		font-family:PingFang SC;
		font-weight:500;
		color:rgba(153,153,153,1);
		flex: 1;
		margin: 0 30rpx;
	}
	image{
		width:12rpx;
		height:23rpx;
	}
}
</style>
